# import gevent
# import time
# from gevent import monkey
# monkey.patch_all()
#
# num = 0
# def work():
#     global num
#     for i in range(10000):
#         num += 1
#
# w1 = gevent.spawn(work)
# w2 = gevent.spawn(work)
# w3 = gevent.spawn(work)
# gevent.joinall([w1, w2, w3])
# time.sleep(3)
# print(num)
#

# import threading, time
#
# lock = threading.Lock()
# num = 0
# def work():
#     global num
#     for i in range(1000000):
#         lock.acquire()
#         num += 1
#         lock.release()
#
# if __name__ == '__main__':
#     w1 = threading.Thread(target=work)
#     w2 = threading.Thread(target=work)
#     w3 = threading.Thread(target=work)
#     w1.start()
#     w2.start()
#     w3.start()
#     time.sleep(10)
#     print(num)


# import multiprocessing, time
#
# num = 0
# def work(a):
#     global num
#     for i in range(1000):
#         num += 1
#     print(num)
#
# if __name__ == '__main__':
#     pool = multiprocessing.Pool()
#     pool.map(work, [i for i in range(10)])


